<?php 
/**
 * @package WapBilling
 * @author Oliver Leisalu

 * DO BEFORE USING
 * 1) Add config file to your config dir. (see sample-conf.php, rename it to wapBilling.conf.php)
 * 2) Start Dom framework before using any WapBilling features.
 * 3) Connect to database before making any payments. (For logging)
 * 4) Call WapBillingLog::getTable()->update(); This will create logging table!
 * 
 * Simulating: http://site.com/?msisdn=SAMPLE_NUM&resolveTo=OPERATOR
 * 
 */

if( $_POST['pank'] ) {
	
	$payment = WapBilling::pay( $_POST['price'], 'Test payment', 'some id');
	if( $payment == 0 ) {
		echo 'Paid <b>'.$_POST['price'].'</b> EUR successfully!<br>';
	} else {
		echo 'Payment failed! Error: <b>'.$payment.'</b>. Error message: <b>'.WapBilling::getLastError().'</b>';
	}
	
}
echo 'Operator: '.WapBilling::getOperator().' PhoneNr: '.WapBilling::getPhoneNr().'<br>';
?>
<form name="form" action="" method="post">
	<input type="text" value="0.01" name="price">
	<input type="submit" name="pank" value="Maksa">
</form>

